Previous Book Contents Book Index Next

Inside Macintosh: Programming With the Text Encoding Conversion Manager /
Chapter 4 - Unicode Converter Reference / Unicode Converter Functions
Setting the Fallback Handler /


SetFallbackUnicodeToTextRun

Associates an application-defined fallback handler with a specific Unicode converter object for multiple text runs to be used with the function ConvertFromUnicodeToTextRun (page 150) or ConvertFromUnicodeToScriptCodeRun (page 155).

pascal OSStatus SetFallbackUnicodeToTextRun (
      UnicodeToTextRunInfo iUnicodeToTextRunInfo, 
      UnicodeToTextFallbackUPP iFallback, 
      OptionBits iControlFlags, 
      LogicalAddress iInfoPtr); 
iUnicodeToTextInfo
The Unicode converter object with which the fallback handler is to be associated. You use the function CreateUnicodeToTextRunInfo (page 145), CreateUnicodeToTextRunInfoByEncoding (page 147), or CreateUnicodeToTextRunInfoByScriptCode (page 149) to obtain a Unicode converter object to specify for this parameter.
iFallback
A universal procedure pointer to the application-defined fallback routine. For a description of the function prototype that your fallback handler must adhere to, see UnicodeToTextFallbackProcPtr (page 122). For a description of how to create your own fallback handler, see MyUnicodeToTextFallbackProc (page 177). You should use the NewUnicodeToTextFallbackProc macro described in the discussion of the function SetFallbackUnicodeToText (page 172).
iControlFlags
Control flags that stipulate which fallback handler the Unicode Converter should call--the application-defined fallback handler or the default handler--if a fallback handler is required, and the sequence in which the Unicode Converter should call the fallback handlers if either can be used when the other fails or is unavailable. See "Fallback-Handler Control Flags" (page 115).
iInfoPtr
The address of a block of memory to be passed to the application-defined fallback handler. The Unicode Converter passes this pointer to the application-defined fallback handler as the last parameter when it calls the fallback handler. Your application can use this block to store data required by your fallback handler whenever it is called. This is similar in use to a reference constant (refcon). If you don't need to use a memory block, specify NULL for this parameter.
function result
A result code. See "Text Encoding Conversion Manager Result Codes" (page 42) in the chapter "Basic Text Types Reference."
DISCUSSION
You use this function to specify a fallback handler to be used for converting a Unicode text segment to another encoding when the Unicode Converter cannot convert the text using the mapping table specified by the Unicode converter object passed to the function ConvertFromUnicodeToText (page 139), ConvertFromUnicodeToTextRun (page 150), ConvertFromUnicodeToPString (page 165), or ConvertFromUnicodeToScriptCodeRun (page 155). You can define multiple fallback handlers and associate them with different Unicode converter objects, depending on your requirements.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 NOV 1997